/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.platformservice.persistence.api;

import org.proteusframework.core.api.IDelegateConsumer;

import java.io.File;
import java.io.IOException;

/**
 * Package Manager.
 *
 * @author Tacoma Four
 */
public interface IPackageManager extends IDelegateConsumer
{
    //
    // Project Packaging
    //

    /**
     * Indicates if the persistence store supports packaging, or exporting, of projects out of its storage medium.
     *
     * @return true, if the persistence store can export a package file
     */
    boolean supportsPackageManagement();

    /**
     * Reads or writes a single file representation of the current project based on the configuration of the actual
     * visitor. The characteristics of the package file generated by the visitor are visitor specific and outside
     * the scope of either the <code>IPackageManager</code> or {@link IPersistenceService}.
     *
     * @param packageFile Package file
     * @param visitor     Package Visitor
     * @throws java.io.IOException When the visitation failed due to an I/O error
     */
    void acceptPackageVisitor(IPackagingVisitor visitor, File packageFile) throws IOException;
}
